agentHost: adopt AHP protocol updates (PR 188)#320004
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates VS Code’s agent host integration to match upstream agent-host-protocol commit 740f6cf (PR 188), adopting the protocol’s breaking changes around tool-call attribution, MCP server lifecycle state, and changeset operation status, while keeping a local protocol divergence for ResourceWatchState.
Changes:
- Replace
toolClientIdwithcontributor: { kind, clientId | customizationId }for tool calls, and update host/renderer logic + tests accordingly. - Add MCP server
enabled+statefields across protocol types, reducers, parsers, and test stubs; introduceSessionMcpServerStateChanged. - Add
ChangesetOperationStatusand plumb operation status handling through changeset reducers/providers and fixtures.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/common/plugins/convertBareEnvVarsToVsCodeSyntax.test.ts | Updates MCP server customization stubs with required enabled/state. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts | Migrates test fixtures from toolClientId to contributor. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Uses contributor to distinguish client vs server tool calls. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts | Filters out bare MCP server customizations from plugin-item view. |
| src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts | Narrows customization type in test setup for new union shape. |
| src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts | Updates MCP server customization stubs with enabled/state. |
| src/vs/platform/agentPlugins/common/pluginParsers.ts | Ensures generated MCP server customizations include enabled/state. |
| src/vs/platform/agentHost/test/node/reducers.test.ts | Updates reducer fixtures for new ChangesetOperationStatus. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Updates tool-call fixtures to contributor. |
| src/vs/platform/agentHost/test/node/mockAgent.ts | Emits tool calls using contributor and adapts helper plumbing. |
| src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts | Updates MCP server customization stubs with enabled/state. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Updates assertions to validate contributor instead of toolClientId. |
| src/vs/platform/agentHost/test/node/copilotAgent.test.ts | Narrows customization types to PluginCustomization and adapts child access. |
| src/vs/platform/agentHost/test/node/claudeAgent.test.ts | Narrows customization progress typing to PluginCustomization. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updates tool-call fixtures and customization progress typing for protocol changes. |
| src/vs/platform/agentHost/test/node/agentPluginManager.test.ts | Adjusts progress typing and assertions for narrowed customization types. |
| src/vs/platform/agentHost/test/node/agentHostChangesetOperationContributionService.test.ts | Updates operation fixtures to include status. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Migrates client-tool-call detection to contributor semantics. |
| src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts | Produces contributor metadata for client-provided tools. |
| src/vs/platform/agentHost/node/copilot/copilotAgent.ts | Narrows synced customizations to PluginCustomization and keeps enablement type-safe. |
| src/vs/platform/agentHost/node/claude/customizations/claudeSessionClientCustomizationsModel.ts | Updates customization snapshot comparison logic for new types. |
| src/vs/platform/agentHost/node/claude/customizations/claudeSdkCustomizationBundler.ts | Narrows bundle result to PluginCustomization. |
| src/vs/platform/agentHost/node/agentPluginManager.ts | Narrows progress/status types to PluginCustomization. |
| src/vs/platform/agentHost/node/agentHostSkillCompletionProvider.ts | Skips bare MCP servers and extracts skills without relying on .children on all variants. |
| src/vs/platform/agentHost/node/agentHostCommitOperationProvider.ts | Adds default ChangesetOperationStatus.Idle to commit operation contribution. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Re-exports newly added protocol enums (tool contributors, operation status). |
| src/vs/platform/agentHost/common/state/protocol/version/registry.ts | Registers protocol introduction versions for new actions. |
| src/vs/platform/agentHost/common/state/protocol/common/commands.ts | Adds ClientCapabilities to initialize params. |
| src/vs/platform/agentHost/common/state/protocol/common/actions.ts | Adds new action types and unions (MCP server state + changeset op status). |
| src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts | Introduces MCP server lifecycle state types and tool-call contributor union. |
| src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.ts | Updates reducer for contributor and adds SessionMcpServerStateChanged handling. |
| src/vs/platform/agentHost/common/state/protocol/channels-session/actions.ts | Defines SessionMcpServerStateChanged and updates tool-call start payload. |
| src/vs/platform/agentHost/common/state/protocol/channels-root/state.ts | Documents/permits top-level MCP server customizations in agent info. |
| src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts | Adds ChangesetOperationStatus and required status field on operations. |
| src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.ts | Handles ChangesetOperationStatusChanged and clears stale errors. |
| src/vs/platform/agentHost/common/state/protocol/channels-changeset/actions.ts | Adds ChangesetOperationStatusChanged action. |
| src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts | Regenerates action origin unions/dispatchability for new actions. |
| src/vs/platform/agentHost/common/state/protocol/.ahp-version | Updates synced upstream protocol commit marker. |
| src/vs/platform/agentHost/common/customAgents.ts | Skips top-level MCP server customizations when computing selectable agents. |
| src/vs/platform/agentHost/common/agentPluginManager.ts | Narrows ISyncedCustomization.customization and progress callback types. |
| src/vs/platform/agentHost/common/agentHostCustomizationConfig.ts | Narrows container conversion helper to return PluginCustomization. |
| scripts/sync-agent-host-protocol.ts | Applies local protocol divergence post-sync (and now runs patch hook during sync). |
Copilot's findings
- Files reviewed: 42/42 changed files
- Comments generated: 2
Syncs the agent-host-protocol types to upstream 740f6cf and adopts the breaking changes from PR 188, while reverting PR 191 (Changeset/ChangesSummary rename) which we are not ready to adopt yet.
- Replaces `toolClientId` on tool-call actions with `contributor: { kind, clientId }` so the renderer/server can distinguish client vs MCP-provided tools
- Plumbs the new `ChangesetOperationStatus` field through commit-operation provider, tests, and reducer fixtures
- Adds the required `enabled`/`state` fields to McpServerCustomization stubs across tests and pluginParsers
- Narrows `ISyncedCustomization.customization` and related helpers to `PluginCustomization` so per-plugin `children`/`load` access is type-safe
- Reverts PR 191 changes in the synced protocol files: keeps `ChangesetSummary` (with `additions`/`deletions`/`files`) and drops `ChangesSummary` from `SessionSummary`
(Commit message generated by Copilot)
b703937 to
cdfa5a2
Compare
Yoyokrazy
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs the agent-host-protocol types to upstream
740f6cfand adopts the breaking changes from PR 188, while skipping PR 191 (Changeset/ChangesSummaryrename), which we're not ready to adopt yet.toolClientIdon tool-call actions withcontributor: { kind, clientId }so the renderer/server can distinguish client- vs MCP-provided tools.ChangesetOperationStatusfield through the commit-operation provider, tests, and reducer fixtures.enabled/statefields toMcpServerCustomizationstubs across tests andpluginParsers.ISyncedCustomization.customizationand related helpers toPluginCustomizationso per-pluginchildren/loadaccess is type-safe.Snapshot.stateto keepResourceWatchStatein the union (still produced by the local agent host onsubscribe), with a post-sync patch inscripts/sync-agent-host-protocol.tsso future re-syncs preserve it.